package Person.ith_03;

 class Student {
    //成员变量
    private String name;
    private int age;

    //无参法
    public Student() {

    }

    //有参法
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Student(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void show() {
        System.out.println(name + " " + age);
    }
}

public class StudentDemo {
    public static void main(String[] args) {
        Student s1 = new Student("户",18);
       s1.show();
       Student s2 = new Student("家");
       s2.show();
       Student s3 = new Student();
       s3.setAge(18);
       s3.show();
    }
}
